Hello, I don't know where you have looked for an encoder or exactly what features you're looking for but Encoder Products company has a variety of encoders for about $150 if I'm not mistaken. I use Encoder products encoders on many applications and they are reliable with a quick delivery. I've also found encoders on Ebay for less than $100 but I can't vouch for those. Good Luck AZ
Group: DynoMotion |
Message: 13070 |
From: mljh |
Date: 4/5/2016 |
Subject: Re: How to pick up where I left off... |
Over a year ago I spent several weeks researching, talking to Tom and a couple of knowledgeable KFLOP users and quickly got lost in the weeds. That coupled with the install error at the time and many many other things going on, the project sat there. You know how it goes.
Anyway, the good news is I'm getting back up to speed. Thankfully I took great notes. The encoder Morray linked to is inexpensive and looks serviceable so I ordered one to try. I'll have to figure out how to rig it but even worse case I could use a friction wheel running against the main timing belt - at least temporarily to get things configured. Meanwhile, it's back to configuring the KFLOP/KSTEP and finishing off the control box to hold the power supply, eStop circuitry and KFLOP/KSTEP.
I moved the PC I'm using to control the lathe to my office so I can relax while working on this. I updated to Windows 10 (from 7) and I'm really pleased with the performance and usability. I'd already updated 4 other PCs so knew what to expect.
Before I update I want to make sure I recover what I had previously done. So I launched KMOTION and have some questions.
I did not have the KFLOP/KSTEP hooked up via USB when I launched KMOTION. I do not see any of the configuration that I had previously done. There is no File->Load parameters so I'm guessing everything resides on KFLOP and if I connected it I would see what was loaded? Is there a way to save this type of config? I did find my C program - which I called user1 for some reason - and am able to load and compile it.
Before I upgrade KMOTION and the firmware I want to make sure I won't lose any past work - but first I need to make sure I defamiliarize myself with the past work.
Any recommendations? Can I upgrade without fear of losing my previous work? I am going to zip and save the entire dynomotion folder as a backup, I just want to know what to expect.
Michael
|
|
Group: DynoMotion |
Message: 13071 |
From: Tom Kerekes |
Date: 4/5/2016 |
Subject: Re: How to pick up where I left off... |
Hi Michael,
Although possible to save parameters to KFLOP we don't recommend
it. We recommend to always leave KFLOP in a virgin state and let it
be initialized by your KMotion.exe Screen settings or by your
initialization C Program. If you did flash parameter settings into
a KFLOP they wouldn't necessarily appear in the KMotion.exe screens
unless you upload the settings from KFLOP into the screens.
Settings in KMotion.exe screens persist from one run to the next
because they are saved in a file \KMotion\Data\config.txt
KMotion.exe Screen Axis settings can also be loaded/saved as *.mot
files.
KMotion.exe Screen Axis settings can also be imported from an
initialization C Program that you have previously created.
This Flash video may help you understand:
http://dynomotion.com/Help/FlashHelp/Parameters/index.html
Its up to you to keep track of what you have changed and what files
you have created and where you have saved them.
It might be better for you to start from scratch so you know what
you have done. Its not that hard once you know what you are doing.
HTH
Regards
TK
Over a year ago I spent several weeks researching,
talking to Tom and a couple of knowledgeable KFLOP users
and quickly got lost in the weeds. That coupled with the
install error at the time and many many other things going
on, the project sat there. You know how it goes.
Anyway, the good news is I'm getting back up to speed.
Thankfully I took great notes. The encoder Morray linked
to is inexpensive and looks serviceable so I ordered one
to try. I'll have to figure out how to rig it but even
worse case I could use a friction wheel running against
the main timing belt - at least temporarily to get things
configured. Meanwhile, it's back to configuring the
KFLOP/KSTEP and finishing off the control box to hold the
power supply, eStop circuitry and KFLOP/KSTEP.
I moved the PC I'm using to control the lathe to my
office so I can relax while working on this. I updated to
Windows 10 (from 7) and I'm really pleased with the
performance and usability. I'd already updated 4 other PCs
so knew what to expect.
Before I update I want to make sure I recover what I
had previously done. So I launched KMOTION and have some
questions.
I did not have the KFLOP/KSTEP hooked up via USB when I
launched KMOTION. I do not see any of the configuration
that I had previously done. There is no File->Load
parameters so I'm guessing everything resides on KFLOP and
if I connected it I would see what was loaded? Is there a
way to save this type of config? I did find my C program -
which I called user1 for some reason - and am able to load
and compile it.
Before I upgrade KMOTION and the firmware I want to
make sure I won't lose any past work - but first I need to
make sure I defamiliarize myself with the past work.
Any recommendations? Can I upgrade without fear of
losing my previous work? I am going to zip and save the
entire dynomotion folder as a backup, I just want to know
what to expect.
Michael
|
|
Group: DynoMotion |
Message: 13072 |
From: mljh |
Date: 4/5/2016 |
Subject: Re: How to pick up where I left off... |
Thanks Tom. That's the fact of the matter "it's not that hard once you know what you are doing!" It's getting to know what you are doing that's the painful part!
|
|
Group: DynoMotion |
Message: 13074 |
From: mljh |
Date: 4/5/2016 |
Subject: Re: How to pick up where I left off... |
Thanks Tom, the flash video was helpful. I remember watching that before.
So I was able to load the screens and retrieve where I left off. I have my original - albeit very simplistic - C program and I'm able to run it. At this point I'm going to update KMOTION and firmware and start from scratch.
|
|
Group: DynoMotion |
Message: 13078 |
From: mljh |
Date: 4/5/2016 |
Subject: Re: How to pick up where I left off... |
And the pain picks up where I left off unfortunately.
I tested with the older release & firmware and verified my C program was loading and running - I see a welcome message printed on the console.
I then updated to the latest 4.33 software and firmware and again test to verify my C program loads and runs. All good so far.
Then, I get Windows 10 into some funky state where keypresses like S popup the search panel. The keyboard would not allow me to edit the C program and certain characters would do system things and others like W would enter properly. I disabled all the ease of access stuff but that did not make any difference. So I rebooted.
And now, although KMOTION connects to my KFLOP, the program compiles and seemingly uploads, I am not seeing my welcome message printed. I can turn on and off the LEDs from the console with SetBit:46 and 47 and ClearBit. So I know I have connected. I uploaded my program to thread 1.
While I'm here... I also noticed that if I issue Reboot! from the console, the KFLOP reboots but will not reconnect. I get an error dialog. I have to unplug USB cable to get a connection. Any info on that greatly appreciated.
Next, what is the consensus/general wisdom on how to configure the Z and X axis for a lathe? I had Channel 0 as my Z and 1 as my X but should check now before I found out that I should have done it differently.
Also, should all of the unused channels inputs and outputs be set to "no ..."? So I would only have 2 active channels, presumably 0 and 1?
thanks, Michael
|
|
Group: DynoMotion |
Message: 13079 |
From: Moray Cuthill |
Date: 4/5/2016 |
Subject: Re: How to pick up where I left off... |
I can't really comment about the strange windows/keyboard problem. Does Win10 have some form of sticky keys that could be the problem? Or even something simpler like a sticky/faulty key on your keyboard?
If you open the console window, and send 'Version', do you get a status/version message displayed from the KFlop? There was an issue with the Reboot command, however I thought that it had been fixed. It's not a command you would use under normal circumstances, as it's usually easier to just cycle the power.
You configure the X and Z as you would any other machine. The DefineCoordSystem() function, requires 4 parameters, which must be in the order X,Y,Z,A. Any unused axis should be set to -1, so for your lathe with Z on channel 0, and X on channel 1 you should have something like- DefineCoordSystem(1,-1,0,-1);
Moray
|
|
Group: DynoMotion |
Message: 13080 |
From: mljh |
Date: 4/5/2016 |
Subject: Re: How to pick up where I left off... |
Yes, I get a version string that is correct.
I'm really surprised there is not a KSTEP initkstep2axis.c program. Did you start with the 3xis and remove stuff, write one from scratch or something else? I think at this point I'll just focus on getting the 2 axis to work and not attempt the spindle speed control, encoder or end stops. I just want to see if I can get something working as a baseline.
|
|
Group: DynoMotion |
Message: 13081 |
From: Moray Cuthill |
Date: 4/5/2016 |
Subject: Re: How to pick up where I left off... |
If Version is working, then the KFlop is connected and working correctly. One possible catch is printf statements only get transmitted/displayed once a newline character (\n) is added. If you don't have a newline character, then everything simply gets held in a buffer.
I usually start with one of the example files, then remove/add what I need.
I'd recommend starting with the InitKStep3AxisNoDisable example, delete the ch2 stuff, and modify the DefineCoordSystem to suit. Use that to get your axis motors spinning, then work on the other features. Spindle speed control is probably one of the more advanced things to implement, but if you tell us what kind of spindle control you'll be using, we can point you in the right direction.
Moray
|
|
Group: DynoMotion |
Message: 13082 |
From: mljh |
Date: 4/5/2016 |
Subject: Re: How to pick up where I left off... |
Here's the code:
printf("G0602 Lathe\n");
and this was working fine last year and earlier today. Now it isn't I've cleared the KFLOP and reuploaded the program and it does not seem to be calling this main at all. Yet I know I'm connected to the board.
Ok, thanks. I'll start with the 3 axis and go from there.
A number of folks on the CNCZone have used this for their lathes and mills (of course, using Mach3). I remember researching it. Speed control is shown on page 6 - basically 0-10VDC.
|
|
Group: DynoMotion |
Message: 13085 |
From: mljh |
Date: 4/6/2016 |
Subject: Re: How to pick up where I left off... |
Ok, so I started with the 3 axis KSTEP sample, removed channel 2 (keeping 0 and 1), reorganized the axes for the lathe (Z = channel 0, X = channel 1), etc. I added the same printf line at the top of the main(), compiled, uploaded and ran. Still no message printed. Version returns the correct firmware version, ClearBit:47 turns off the correct LED on the board. Thread 1 is selected in the program window.
When I download the program how do I know that 1) it is downloading and 2) when it has completed successfully? I don't see any blinking LEDs or anything in the program window providing download feedback. I have verified that compiling is working - inserting a rogue character generates an error. Even the 6 arrow "compile->download->run" button doesn't seem to upload the program.
I don't have steppers hooked up yet as I wanted to understand the basics before doing that. The printf should tell me that the compile-upload-run cycle is working properly. Up until yesterday it worked fine.
|
|
Group: DynoMotion |
Message: 13086 |
From: mljh |
Date: 4/6/2016 |
Subject: Re: How to pick up where I left off... |
One last try. I copied and pasted the simple Hello World from the wiki and get nada. Even power cycling does not print Hello World. Version from the console gives the version info, the KFLOP is connected. No compile errors. Can't tell if the program downloads as per my previous post.
|
|
Group: DynoMotion |
Message: 13089 |
From: Tom Kerekes |
Date: 4/6/2016 |
Subject: Re: How to pick up where I left off... |
Hi Michael,
Power cycling won't execute programs unless they have been Flashed
into KFLOP Memory and Configured to "Launch on Power up".
Strange you are having so much trouble with all the basics. I can't
think of why something so simple wouldn't work unless you are doing
something strange like mixing versions, or have flashed programs to
KFLOP, or have multiple Versions running.
So I would suggest first making sure KFLOP is restored to defaults
with:
#1 Turn off KFLOP Power
#2 Reboot PC
#3 Run \KMotion433\Release\KMotion.exe
#4 Turn on KFLOP
#5 Use Config\Flash Screen to Flash "New Version"
#6 Exit KMotion.exe
#7 Turn off KFLOP Power
Now test executing a program to print to Console
#1 Run \KMotion433\Release\KMotion.exe
#2 Turn On KFLOP
#3 Open Console Screen
#4 Enter "Version" Verify Firmware Version is V4.33
#5 Open C Programs Screen
#6 Select Thread #1
#7 Open file "print.c"
#8 Push Save/Compile/Download/Run (button with 6 arrows)
#9 Check if "Hello World" is printed on the Console Screen
HTH
Regards
TK
One last try. I copied and pasted the simple Hello World
from the wiki and get nada. Even power cycling does not
print Hello World. Version from the console gives the
version info, the KFLOP is connected. No compile errors.
Can't tell if the program downloads as per my previous
post.
|
|
Group: DynoMotion |
Message: 13090 |
From: mljh |
Date: 4/6/2016 |
Subject: Re: How to pick up where I left off... |
Thanks Tom. I understand about flashing and had actually also tested by power cycling after flashing. I think I'm just cursed, maybe I upset the M*** gods when they caught wind I'm using KFLOP?
So, I unplugged KFLOP, rebooted my PC, ran KMotion, plugged in KFLOP, flashed new version and then shut everything down and restarted everything. I then tested the simple Hello World and that worked this time. I then compiled my work-in-progress 2 axis init program with a printf in it and that also works.
I forgot to mention. I did see the radio button on the program window turn green when I clicked Run. I am seeing that now too and things seem to be working fine.
So at this point I think I have a 2 axis (Z & X) init for the lathe basically configured. I need to finish the electronics box so I can actually test and tune the motors and steps/in on the lathe. This is as bare bones as it gets, 2 stepper motor control, no home or end switches, no spindle control and no eStop. I do have the eStop circuitry wiring in progress but I won't interface it to KFLOP until I get the thing running 2 steppers.
|
|
Group: DynoMotion |
Message: 13091 |
From: Moray Cuthill |
Date: 4/6/2016 |
Subject: Re: How to pick up where I left off... |
Sounds like you've managed the first step.
The thread number turning green indicates there is a program running within that thread, however you need to be aware that the program currently running, may not be the same as the program being displayed for that thread.
Once you have a program running in a thread, you can then load another file, and the original program will continue to run in the KFlop until you Download and Run the currently displayed program. It's the same if you launch a program via KMotionCNC. KMotionCNC will load whatever C program KMotionCNC is set to load, into the thread KMotionCNC is set to load the program, completely independently of what C program is currently displayed in the KMotion C Program window for that thread.
Moray
|
|
Group: DynoMotion |
Message: 13092 |
From: mljh |
Date: 4/6/2016 |
Subject: Re: How to pick up where I left off... |
Next up...
Now that I seemingly have the program uploading, I wanted to see how to go about determining which connector on KSTEP is used for Channel 0 and 1 (my Z and X stepper motors in that order). I opened the digital I/O screen KFLOP tab and I see some - I think - odd behavior. The state bits for 2 Enc 1 A and 3 Enc 1 B are flickering checked/unchecked. I can not uncheck the output box. The 8, 9, 19, 11 home are also all set as output although I've explicitly not configured home switches. None of the state bits are set on the KSTEP tab.
Here's a screen shot of what I see.
|
|
|
|
Group: DynoMotion |
Message: 13093 |
From: mljh |
Date: 4/6/2016 |
Subject: Re: How to pick up where I left off... |
Thanks Moray, I understand that about the source you see is not running until you explicitly upload it and run it. I have not even launched KMotionCNC yet!
But as you might see on the post I made while you were posting this, I think I'm seeing some additional odd behavior on just the basic 2 axis stepper control with nothing else configured.
|
|
Group: DynoMotion |
Message: 13094 |
From: Moray Cuthill |
Date: 4/6/2016 |
Subject: Re: How to pick up where I left off... [1 Attachment] |
That sounds perfectly normal. When you connect and configure add-on boards to a KFlop, certain KFlop inputs/outputs are used to control the add-on board (in your case the KStep). If you look at the Hardware/Connector page for the KFlop, you'll most likely find all those Bits you've listed relate to the connector that the KStep is using.
As for the KStep State Bits, they'll not show ticked unless you apply the required power to the input pins on JP33.
The details for all the connectors can be found on the main Dynomotion Help Contents/index page, either at http://www.dynomotion.com/Help/ or via the Help menu within KMotion (or by clicking help from any KMotion/KMotionCNC window, then Home)
Moray
|
|
Group: DynoMotion |
Message: 13103 |
From: mljh |
Date: 4/6/2016 |
Subject: Re: How to pick up where I left off... |
I've decided to hook up a small test bed in my office (like in Tom's video) while I complete assembly of my control box. Basically, this consists of 2 small NEMA 17 steppers (<1A) and a 12V DC power supply. My goal is to hook these up and get them to run lathe gcode. I want to sanity check everything so I don't release the magic smoke. I've annotated my questions in bold.
Since my steppers are <1A I do not need any current setting jumpers. I have all 3 jumpers on the voltage clamp pins ABC. I am using steppers that I use on my 3D printers and have verified the coils. These are hooked up to J2 (motor 0 which will be my Z axis) and J3 (motor 1 which will be my X axis).
Currently I have the jumper on J3 on the KFLOP so I could test with USB power - this was before setting this test bed up. First question, since I am going to provide power through the KSTEP J1, I need to leave that jumper in place and power the board from USB, correct? The 12VDC supply will be connected to J1 on the KSTEP. I assume that I can use either GND and either VB terminal on the four terminal, is that correct? (why are there 2 sets of terminals on J1?)
The isolation jumpers are installed on JP34 and JP35 since I'm powering the board from USB.
I think that's everything. I'll wait for verification that this is correct before powering up as my luck to date has been on the "bad" side!
|
|
Group: DynoMotion |
Message: 13104 |
From: Tom Kerekes |
Date: 4/6/2016 |
Subject: Re: How to pick up where I left off... |
Hi Michael,
That all sounds correct. Although when you use the word "power" you
might be specific about what power you are referring to.
Install KFLOP USB jumper J3 and KSTEP Isolation jumpers JP34 and
JP35 to supply both KFLOP and KSTEP +5V from USB.
Yes you can use either GND or VB terminals on KSTEP J1. If your
total current is more than 10Amps use both connections. It is not
in your case.
HTH
Regards
TK
I've decided to hook up a small test bed in my office
(like in Tom's video) while I complete assembly of my
control box. Basically, this consists of 2 small NEMA 17
steppers (<1A) and a 12V DC power supply. My goal is to
hook these up and get them to run lathe gcode. I want to
sanity check everything so I don't release the magic
smoke. I've annotated my questions in bold.
Since my steppers are <1A I do not need any current
setting jumpers.
I have all 3 jumpers on the voltage clamp pins ABC.
I am using steppers that I use on my 3D printers and
have verified the coils. These are hooked up to J2 (motor
0 which will be my Z axis) and J3 (motor 1 which will be
my X axis).
Currently I have the jumper on J3 on the KFLOP so I
could test with USB power - this was before setting this
test bed up. First
question, since I am going to provide power through the
KSTEP J1, I need to leave that jumper in place and power
the board from USB, correct? The 12VDC supply will be
connected to J1 on the KSTEP. I assume that I can use
either GND and either VB terminal on the four
terminal, is that correct? (why are there 2
sets of terminals on J1?)
The isolation
jumpers are installed on JP34 and JP35 since I'm
powering the board from USB.
I think that's
everything. I'll wait for verification that this is
correct before powering up as my luck to date has been
on the "bad" side!
|
|
Group: DynoMotion |
Message: 13107 |
From: mljh |
Date: 4/7/2016 |
Subject: Re: How to pick up where I left off... |
This is much like that old Three Stooges episode...
I hooked everything up, double checked, triple checked and then muttered a few incantations to the CNC deities.
Then I opened KMotion and followed along with the KSTEP Introduction video. '
Channel 0 stepper moving nicely. Channel 1 stepper moving nicely.
I then loaded the sample InitKSTEP3Axis.c program and carefully edited it to create a 2 axis version and defined my coordinate system:
DefineCoordSysem(1, -1, 0, -1);
I saved and test compiled the program to make sure there were no compile errors. The next step in the video is to open KMotionCNC and go to Tool Setup to point to my new init program.
I click Init and see X and Z DROs turn green, Y is yellow (as I would expect). Great! I can jog X and Z and the correct stepper moves. This is all looking good. Now I need some 2 axis (X-Z) lathe gcode to test. I didn't see any samples in the GCode folder so I edited the circleXY_XZ_YZ.ngc to create a simple test: G20 F12 G0 X0 Z0 G18 G2 Y0 Z0 I0 K1.0 M2 and I'm getting what looks to be correct coordinated motion and the G Code Viewer is showing a circle in the XZ axis view. Things are looking good with the basic 2 axis control.
I haven't spent time with KMotionCNC in the past so now I need to get up to speed with that over the next few days while I work on my control box. Is it configurable to create a basic lathe screen or does that require VisualStudio programming?
|
|
|
|
Group: DynoMotion |
Message: 13108 |
From: mljh |
Date: 4/7/2016 |
Subject: Re: How to pick up where I left off... |
Ok, found the screen "faces" drop down in tool setup. I'll go quiet now and read help and the wiki before asking pesky questions!
|
|
Group: DynoMotion |
Message: 13112 |
From: mljh |
Date: 4/7/2016 |
Subject: Re: How to pick up where I left off... |
Ok, I'm back! I spent a bit of time reading a lot of docs and experimenting but I have a persistnant issue I don't understand and can't seem to change. The issue is that in KMotionCNC the X axis DRO updates when I jog the with the Z jog buttons and vice versa. So I stepped back and reconfigured things like this:
J2 connector will be my X axis on Channel 0 -> Output Channel 8 J3 connector will be my Z axis on Channel 1 -> Output Channel 9
I updated the C program after making these changes and verified they "stuck". I then edited the coordinate system to (0, -1, 1, -1). Saved/Compiled/Uploaded/Run.
Then I launched KMotionCNC, clicked the Init button (the edited program is the same name and in same location) and jogged. I have the lathe 2 axis screen installed. Clicking the Z axis jog buttons cause my X stepper (J2 connector, Channel 0) to move but the X DRO is updated on screen. The opposite occurs when I click the X jog buttons.
So it seems I that the steppers and DROs are correct but the axes jog buttons are not.
I then tried swapping the coordinate system to (1, -1, 0, -1) and tested. Now, the Z jog button jogs the stepper on KSTEP connector J3 (what I want to be my Z axes) but the X axes DRO is still updated. I must be overlooking some detail.
|
|
Group: DynoMotion |
Message: 13118 |
From: mljh |
Date: 4/8/2016 |
Subject: Re: How to pick up where I left off... |
It turns out that there is a checkbox on the Tool Setup->Trajectory Planner tab in the Lathe Options box called Lathe. Check that and all is well. A google search found it: http://www.dynomotion.com/Help/KMotionCNC/ToolSetupScreenTP.htm
Now I'm off to the races. I'm working on my eStop routine and have a basic estop handler implemented (simple). The questions I have now are around best practices with KSTEP and KFLOP for doing things like:
1) estop handling 2) HOME handling 2) using the KSTEP relays drivers (for coolant, etc) 3) using the KSTEP analog out for VFD spindle control
Are there any published real world examples of these?
I've looked through the sample code and that has been helpful. I assume that the simple samples that demonstrate something in a while{} in a simple main can just be taken and put into my program's while{} or is the intent that these are run in individual threads?
|
|
Group: DynoMotion |
Message: 13127 |
From: Moray Cuthill |
Date: 4/9/2016 |
Subject: Re: How to pick up where I left off... |
Hi Michael,
for my KStep powered probing machine/CMM, I have the E-stop simply wired to kill power to the stepper power supply (basic toroidal/bridge rectifier/capacitor setup), and also tied in to a KStep input so the KFlop gets notified. The E-stop handling code in the KFlop then kills the KStep enable. However on a larger machine that could be a problem, as simply disabling the KStep could allow the steppers to freewheel, which could potentially be quite dangerous. It would probably be wiser to have the E-Stop handler bring any motion to a stop before removing the enable. My machine is based on a Chinese 3040 machine, so it's not got enough weight or power to do much damage.
Homing can be handled however you like. Basic system is usually move into a home switch until it triggers, then slowly back of until it untriggers, at which point the axis positions typically get zeroed. You can potentially use limit switches for homing, but that means not having them trigger a hard e-stop (I personally cringe at the thought of limit switches not cutting all motion power directly, but on small machines it's probably not that major an issue).
Basic outputs are easy to handle. In KMotionCNC, in Tool Setup, use the I/O Bit option against the relevant M Codes. VFD control can be a bit harder than it first appears, depending on what you'd like to achieve. Basic output can be handled with the 0-10V, however as you'll be using an encoder, it does give you an option to run closed loop for precise speed control, but if you want to run in reverse, it's a bit more involved as you need to create a custom output for the spindle channel.
Moray
|
|
Group: DynoMotion |
Message: 13128 |
From: Tom Kerekes |
Date: 4/9/2016 |
Subject: Re: How to pick up where I left off... |
Hi Michael,
#1 Estop is a complex subject with many possibilities. Please
research the forums
#2 See the SimpleHomeIndexFunctionTest.c example
#3 assign associated I/O bit to M Codes
#4 See Analog Output Section here:
http://dynomotion.com/Help/SchematicsKStep/UsingKStep.htm
See the example: \C Programs\KStep\KMotionCNC\Spindle_S_Kstep.c
HTH
Regards
TK
It turns out that there is a checkbox on the Tool
Setup->Trajectory Planner tab in the Lathe Options box
called Lathe. Check that and all is well. A google search
found it: http://www.dynomotion.com/Help/KMotionCNC/ToolSetupScreenTP.htm
Now I'm off to the races. I'm working on my eStop
routine and have a basic estop handler implemented
(simple). The questions I have now are around best
practices with KSTEP and KFLOP for doing things like:
1) estop handling
2) HOME handling
2) using the KSTEP relays drivers (for coolant, etc)
3) using the KSTEP analog out for VFD spindle control
Are there any published real world examples of these?
I've looked through the sample code and that has been
helpful. I assume that the simple samples that
demonstrate something in a while{} in a simple main can
just be taken and put into my program's while{} or is
the intent that these are run in individual threads?
|
|
Group: DynoMotion |
Message: 13130 |
From: mljh |
Date: 4/9/2016 |
Subject: Re: How to pick up where I left off... |
Thanks Moray. Actually, I guess I didn't ask my question clearly enough! I've built 5 CNC machines (mills and a router) and 8 3D printers. The mills at least all have good eStop handling, etc. What I meant to ask was what are some best programming practices in KMotion for these tasks? My machines are not huge production floor machines. The lathe I'm working on is a Grizzly G0602 conversion (a 10" x 22" lathe).
To start, I'll run the VFD open loop and deal with the encoder once I have the basic lathe functional. I rarely ever run the lathe in reverse so I can leave that as a future project too. I'm actually pretty close with the program now - at least with testing on my desktop.
So, for specifics, you mention a few good points on the eStop. What is a recommended/best practice for implementing that in software? Something like this:
In my main for(ever) loop, ReadBit the digital IO I'm using for eStop indication. This is actually wired into 3 physical eStop buttons strategically placed around the lathe as well as the limit switches. So any one of these activates and I process it as an eStop.
If I detect the eStop in the for(ever) loop, I call my eStop handler function. It currently calls DisableAxis for each Enabled channel. Currently that is channel 0 (X axis) and 1 (Z axis) but ultimately would include the spindle I would imagine. Once the axes are disabled, I kill the KSTEP enable (ClearBit 45 correct?).
Is it that simple or is there more I should be doing? That's the level of detail I'm trying to understand.
Cheers, Michael
|
|
Group: DynoMotion |
Message: 13131 |
From: Moray Cuthill |
Date: 4/9/2016 |
Subject: Re: How to pick up where I left off... |
I'm not sure how KStep deals with disabled channels, but I think it'll simply stop all movement abruptly and keep power applied to the motors.
You could add a delay before the KStep enable signal is removed after an estop, so the KStep can physically stop the motors, otherwise you leave the potential for them to continue freewheeling when the KStep is disabled. However, you'd have to weigh up the pros and cons of doing that.
The big issue with lathes, is bad things have usually happened long before an E-stop is handled. I know on my lathe, the only use the Z-axis limit switches have, is to stop the Z-axis guards getting damaged. The turret will be bouncing of the chuck long before a limit switch is reached, and usually long before you get a chance to hit the E-stop even when your stood watching the turret launch towards the spindle after entering the wrong code!
Moray
|
|
| |